package com.balabala.exception;

import com.balabala.gym_enum.ExceptionEnum;
import com.balabala.gym_enum.ResultEnum;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 * @author 何涛
 * @date 2023/4/23 0023
 */

@Data
@NoArgsConstructor
public class CustomerException extends RuntimeException{
    String msg;
    Integer code;

    public CustomerException(String msg) {
        super(msg);
        this.msg = msg;
    }
    public CustomerException(String msg, Integer code)
    {
        this(msg);
        this.code=code;
    }
    public CustomerException(ResultEnum resultEnum)
    {
        this(resultEnum.getMsg(),resultEnum.getCode());
    }
    public CustomerException(ExceptionEnum exceptionEnum){this(exceptionEnum.getMsg(),exceptionEnum.getCode());}
}
